// pages/Mine/Mine.js
Page({

  /**
   * 页面的初始数据
   */
  data: {
    imageUrls:[
      '/pages/image/haigui-1.jpg',
      '/pages/image/haigui-2.jpg',
      '/pages/image/haigui-3.jpg',
      '/pages/image/haigui-4.jpg',
      '/pages/image/haigui-5.jpg'
    ],
    itemList: [
      {
        iconImageName:'/pages/image/icon/icon_1.png',
        iconTitleName:'测试1'
      },
      {
        iconImageName: '/pages/image/icon/icon_2.png',
        iconTitleName: '测试2'
      },
      {
        iconImageName: '/pages/image/icon/icon_3.png',
        iconTitleName: '测试3'
      },
      {
        iconImageName: '/pages/image/icon/icon_4.png',
        iconTitleName: '测试4'
      },
      {
        iconImageName: '/pages/image/icon/icon_5.png',
        iconTitleName: '测试5'
      },
      {
        iconImageName: '/pages/image/icon/icon_6.png',
        iconTitleName: '测试6'
      },
      {
        iconImageName: '/pages/image/icon/icon_5.png',
        iconTitleName: '测试7'
      },
      {
        iconImageName: '/pages/image/icon/icon_2.png',
        iconTitleName: '测试8'
      },
    ],
    itemListCell: [
      {
        courseImage: '/pages/image/icon/icon_1.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription:'身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_1.png',
        courseTitle: '家居风水解读您的健康，准的1',
        courseDescription: '身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_1.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription: '身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_2.png',
        courseTitle: '家居风水解读您的健康，准',
        courseDescription: '身体各种毛病，或情绪能身体各种毛病，或情绪能身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_3.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription: '身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_4.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription: '身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_5.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription: '身体各种毛病，或情绪能'
      },
      {
        courseImage: '/pages/image/icon/icon_6.png',
        courseTitle: '家居风水解读您的健康，准的让人惊奇',
        courseDescription: '身体各种毛病，或情绪能'
      },
    ]
  },
  textClickAction:function(e){
    var kind = e.target.id;
    console.log(kind+'aasasas');
    var that = this;
    wx.navigateTo({
      url: '../CoureseDetailList/CoureseDetailList',
    })
  },
  MoreCourseListTwo:function(e){
    var that = this;
    wx.navigateTo({
      url: '../CoureseDetailList/CoureseDetailList?navtitle=慕课专栏',
    })
  },
  MoreCourseListOne:function(e){
    var that = this;
    wx.navigateTo({
      url: '../CoureseDetailList/CoureseDetailList?navtitle=私塾课堂',
    })
  },
  swiperitemClickAction: function (e) {
    var kind = e.target.id;
    console.log(kind); 
    var that = this;
    wx.navigateTo({
      url: '../CoureseDetailCourse/CoureseDetailCourse?navtitle=私塾课堂',
    })
  },
  SmallItmeListClicAction:function(e){
    // var kind =e.cu.id;
    console.log(e);
  },
  listItemClickAction:function(e){
    var kind = e.target.id;
    console.log(e);
  },
  clickListTwoAction:function(e){
    var kind = e.target.id;
    console.log(e);
  },
  imageLoad:function(e){
    var $width = e.detail.width;
    var $height = e.detail.height;
    ration = $width/$height;
    var viewWidht = 718;
    viewHeight = 718/ration;
    var image = this.data.images;
    image[e.target.dataset.index]={
      width:viewWidht,
      heigh:viewHeight
    }
    this.setData({
      images:image
    })
  },


  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log('onLoad')
    var that = this;
    var userName;
    if (wx.getStorageSync('LoginSessionKye').userName == undefined) {

      console.log('请登录' + wx.getStorageSync('LoginSessionKye'));
     
    } else {
      userName = wx.getStorageSync('LoginSessionKye').userName;
      console.log('已登录111' + wx.getStorageSync('LoginSessionKye'));
    }

  },

  /*
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})